home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / binutils.7 / binutils / binutils-2.7 / gas / doc / as.info-5 < prev    next >
Encoding:
GNU Info File  |  1996-07-15  |  35.2 KB  |  925 lines

  1. This is Info file as.info, produced by Makeinfo-1.55 from the input
  2. file ./as.texinfo.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * As: (as).                     The GNU assembler.
  6. END-INFO-DIR-ENTRY
  7.  
  8.    This file documents the GNU Assembler "as".
  9.  
  10.    Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation,
  11. Inc.
  12.  
  13.    Permission is granted to make and distribute verbatim copies of this
  14. manual provided the copyright notice and this permission notice are
  15. preserved on all copies.
  16.  
  17.    Permission is granted to copy and distribute modified versions of
  18. this manual under the conditions for verbatim copying, provided that
  19. the entire resulting derived work is distributed under the terms of a
  20. permission notice identical to this one.
  21.  
  22.    Permission is granted to copy and distribute translations of this
  23. manual into another language, under the above conditions for modified
  24. versions.
  25.  
  26. 
  27. File: as.info,  Node: SH Opcodes,  Prev: SH Directives,  Up: SH-Dependent
  28.  
  29. Opcodes
  30. -------
  31.  
  32.    For detailed information on the SH machine instruction set, see
  33. `SH-Microcomputer User's Manual' (Hitachi Micro Systems, Inc.).
  34.  
  35.    `as' implements all the standard SH opcodes.  No additional
  36. pseudo-instructions are needed on this family.  Note, however, that
  37. because `as' supports a simpler form of PC-relative addressing, you may
  38. simply write (for example)
  39.  
  40.      mov.l  bar,r0
  41.  
  42. where other assemblers might require an explicit displacement to `bar'
  43. from the program counter:
  44.  
  45.      mov.l  @(DISP, PC)
  46.  
  47.    Here is a summary of SH opcodes:
  48.  
  49.      Legend:
  50.      Rn        a numbered register
  51.      Rm        another numbered register
  52.      #imm      immediate data
  53.      disp      displacement
  54.      disp8     8-bit displacement
  55.      disp12    12-bit displacement
  56.      
  57.      add #imm,Rn                    lds.l @Rn+,PR
  58.      add Rm,Rn                      mac.w @Rm+,@Rn+
  59.      addc Rm,Rn                     mov #imm,Rn
  60.      addv Rm,Rn                     mov Rm,Rn
  61.      and #imm,R0                    mov.b Rm,@(R0,Rn)
  62.      and Rm,Rn                      mov.b Rm,@-Rn
  63.      and.b #imm,@(R0,GBR)           mov.b Rm,@Rn
  64.      bf disp8                       mov.b @(disp,Rm),R0
  65.      bra disp12                     mov.b @(disp,GBR),R0
  66.      bsr disp12                     mov.b @(R0,Rm),Rn
  67.      bt disp8                       mov.b @Rm+,Rn
  68.      clrmac                         mov.b @Rm,Rn
  69.      clrt                           mov.b R0,@(disp,Rm)
  70.      cmp/eq #imm,R0                 mov.b R0,@(disp,GBR)
  71.      cmp/eq Rm,Rn                   mov.l Rm,@(disp,Rn)
  72.      cmp/ge Rm,Rn                   mov.l Rm,@(R0,Rn)
  73.      cmp/gt Rm,Rn                   mov.l Rm,@-Rn
  74.      cmp/hi Rm,Rn                   mov.l Rm,@Rn
  75.      cmp/hs Rm,Rn                   mov.l @(disp,Rn),Rm
  76.      cmp/pl Rn                      mov.l @(disp,GBR),R0
  77.      cmp/pz Rn                      mov.l @(disp,PC),Rn
  78.      cmp/str Rm,Rn                  mov.l @(R0,Rm),Rn
  79.      div0s Rm,Rn                    mov.l @Rm+,Rn
  80.      div0u                          mov.l @Rm,Rn
  81.      div1 Rm,Rn                     mov.l R0,@(disp,GBR)
  82.      exts.b Rm,Rn                   mov.w Rm,@(R0,Rn)
  83.      exts.w Rm,Rn                   mov.w Rm,@-Rn
  84.      extu.b Rm,Rn                   mov.w Rm,@Rn
  85.      extu.w Rm,Rn                   mov.w @(disp,Rm),R0
  86.      jmp @Rn                        mov.w @(disp,GBR),R0
  87.      jsr @Rn                        mov.w @(disp,PC),Rn
  88.      ldc Rn,GBR                     mov.w @(R0,Rm),Rn
  89.      ldc Rn,SR                      mov.w @Rm+,Rn
  90.      ldc Rn,VBR                     mov.w @Rm,Rn
  91.      ldc.l @Rn+,GBR                 mov.w R0,@(disp,Rm)
  92.      ldc.l @Rn+,SR                  mov.w R0,@(disp,GBR)
  93.      ldc.l @Rn+,VBR                 mova @(disp,PC),R0
  94.      lds Rn,MACH                    movt Rn
  95.      lds Rn,MACL                    muls Rm,Rn
  96.      lds Rn,PR                      mulu Rm,Rn
  97.      lds.l @Rn+,MACH                neg Rm,Rn
  98.      lds.l @Rn+,MACL                negc Rm,Rn
  99.      
  100.      nop                            stc VBR,Rn
  101.      not Rm,Rn                      stc.l GBR,@-Rn
  102.      or #imm,R0                     stc.l SR,@-Rn
  103.      or Rm,Rn                       stc.l VBR,@-Rn
  104.      or.b #imm,@(R0,GBR)            sts MACH,Rn
  105.      rotcl Rn                       sts MACL,Rn
  106.      rotcr Rn                       sts PR,Rn
  107.      rotl Rn                        sts.l MACH,@-Rn
  108.      rotr Rn                        sts.l MACL,@-Rn
  109.      rte                            sts.l PR,@-Rn
  110.      rts                            sub Rm,Rn
  111.      sett                           subc Rm,Rn
  112.      shal Rn                        subv Rm,Rn
  113.      shar Rn                        swap.b Rm,Rn
  114.      shll Rn                        swap.w Rm,Rn
  115.      shll16 Rn                      tas.b @Rn
  116.      shll2 Rn                       trapa #imm
  117.      shll8 Rn                       tst #imm,R0
  118.      shlr Rn                        tst Rm,Rn
  119.      shlr16 Rn                      tst.b #imm,@(R0,GBR)
  120.      shlr2 Rn                       xor #imm,R0
  121.      shlr8 Rn                       xor Rm,Rn
  122.      sleep                          xor.b #imm,@(R0,GBR)
  123.      stc GBR,Rn                     xtrct Rm,Rn
  124.      stc SR,Rn
  125.  
  126. 
  127. File: as.info,  Node: Sparc-Dependent,  Next: Z8000-Dependent,  Prev: SH-Dependent,  Up: Machine Dependencies
  128.  
  129. SPARC Dependent Features
  130. ========================
  131.  
  132. * Menu:
  133.  
  134. * Sparc-Opts::                  Options
  135. * Sparc-Float::                 Floating Point
  136. * Sparc-Directives::            Sparc Machine Directives
  137.  
  138. 
  139. File: as.info,  Node: Sparc-Opts,  Next: Sparc-Float,  Up: Sparc-Dependent
  140.  
  141. Options
  142. -------
  143.  
  144.    The SPARC chip family includes several successive levels, using the
  145. same core instruction set, but including a few additional instructions
  146. at each level.  There are exceptions to this however.  For details on
  147. what instructions each variant supports, please see the chip's
  148. architecture reference manual.
  149.  
  150.    By default, `as' assumes the core instruction set (SPARC v6), but
  151. "bumps" the architecture level as needed: it switches to successively
  152. higher architectures as it encounters instructions that only exist in
  153. the higher levels.
  154.  
  155.    If not configured for SPARC v9 (`sparc64-*-*') GAS will not bump
  156. passed sparclite by default, an option must be passed to enable the v9
  157. instructions.
  158.  
  159.    GAS treats sparclite as being compatible with v8, unless an
  160. architecture is explicitly requested.  SPARC v9 is always incompatible
  161. with sparclite.
  162.  
  163. `-Av6 | -Av7 | -Av8 | -Asparclet | -Asparclite | -Av9 | -Av9a'
  164.      Use one of the `-A' options to select one of the SPARC
  165.      architectures explicitly.  If you select an architecture
  166.      explicitly, `as' reports a fatal error if it encounters an
  167.      instruction or feature requiring a higher level.
  168.  
  169. `-xarch=v8plus | -xarch=v8plusa'
  170.      For compatibility with the Solaris v9 assembler.  These options are
  171.      equivalent to -Av9 and -Av9a, respectively.
  172.  
  173. `-bump'
  174.      Warn whenever it is necessary to switch to another level.  If an
  175.      architecture level is explicitly requested, GAS will not issue
  176.      warnings until that level is reached, and will then bump the level
  177.      as required (except between incompatible levels).
  178.  
  179. 
  180. File: as.info,  Node: Sparc-Float,  Next: Sparc-Directives,  Prev: Sparc-Opts,  Up: Sparc-Dependent
  181.  
  182. Floating Point
  183. --------------
  184.  
  185.    The Sparc uses IEEE floating-point numbers.
  186.  
  187. 
  188. File: as.info,  Node: Sparc-Directives,  Prev: Sparc-Float,  Up: Sparc-Dependent
  189.  
  190. Sparc Machine Directives
  191. ------------------------
  192.  
  193.    The Sparc version of `as' supports the following additional machine
  194. directives:
  195.  
  196. `.align'
  197.      This must be followed by the desired alignment in bytes.
  198.  
  199. `.common'
  200.      This must be followed by a symbol name, a positive number, and
  201.      `"bss"'.  This behaves somewhat like `.comm', but the syntax is
  202.      different.
  203.  
  204. `.half'
  205.      This is functionally identical to `.short'.
  206.  
  207. `.proc'
  208.      This directive is ignored.  Any text following it on the same line
  209.      is also ignored.
  210.  
  211. `.reserve'
  212.      This must be followed by a symbol name, a positive number, and
  213.      `"bss"'.  This behaves somewhat like `.lcomm', but the syntax is
  214.      different.
  215.  
  216. `.seg'
  217.      This must be followed by `"text"', `"data"', or `"data1"'.  It
  218.      behaves like `.text', `.data', or `.data 1'.
  219.  
  220. `.skip'
  221.      This is functionally identical to the `.space' directive.
  222.  
  223. `.word'
  224.      On the Sparc, the `.word' directive produces 32 bit values,
  225.      instead of the 16 bit values it produces on many other machines.
  226.  
  227. `.xword'
  228.      On the Sparc V9 processor, the `.xword' directive produces 64 bit
  229.      values.
  230.  
  231. 
  232. File: as.info,  Node: Z8000-Dependent,  Next: Vax-Dependent,  Prev: Sparc-Dependent,  Up: Machine Dependencies
  233.  
  234. Z8000 Dependent Features
  235. ========================
  236.  
  237.    The Z8000 as supports both members of the Z8000 family: the
  238. unsegmented Z8002, with 16 bit addresses, and the segmented Z8001 with
  239. 24 bit addresses.
  240.  
  241.    When the assembler is in unsegmented mode (specified with the
  242. `unsegm' directive), an address takes up one word (16 bit) sized
  243. register.  When the assembler is in segmented mode (specified with the
  244. `segm' directive), a 24-bit address takes up a long (32 bit) register.
  245. *Note Assembler Directives for the Z8000: Z8000 Directives, for a list
  246. of other Z8000 specific assembler directives.
  247.  
  248. * Menu:
  249.  
  250. * Z8000 Options::               No special command-line options for Z8000
  251. * Z8000 Syntax::                Assembler syntax for the Z8000
  252. * Z8000 Directives::            Special directives for the Z8000
  253. * Z8000 Opcodes::               Opcodes
  254.  
  255. 
  256. File: as.info,  Node: Z8000 Options,  Next: Z8000 Syntax,  Up: Z8000-Dependent
  257.  
  258. Options
  259. -------
  260.  
  261.    `as' has no additional command-line options for the Zilog Z8000
  262. family.
  263.  
  264. 
  265. File: as.info,  Node: Z8000 Syntax,  Next: Z8000 Directives,  Prev: Z8000 Options,  Up: Z8000-Dependent
  266.  
  267. Syntax
  268. ------
  269.  
  270. * Menu:
  271.  
  272. * Z8000-Chars::                Special Characters
  273. * Z8000-Regs::                 Register Names
  274. * Z8000-Addressing::           Addressing Modes
  275.  
  276. 
  277. File: as.info,  Node: Z8000-Chars,  Next: Z8000-Regs,  Up: Z8000 Syntax
  278.  
  279. Special Characters
  280. ..................
  281.  
  282.    `!' is the line comment character.
  283.  
  284.    You can use `;' instead of a newline to separate statements.
  285.  
  286. 
  287. File: as.info,  Node: Z8000-Regs,  Next: Z8000-Addressing,  Prev: Z8000-Chars,  Up: Z8000 Syntax
  288.  
  289. Register Names
  290. ..............
  291.  
  292.    The Z8000 has sixteen 16 bit registers, numbered 0 to 15.  You can
  293. refer to different sized groups of registers by register number, with
  294. the prefix `r' for 16 bit registers, `rr' for 32 bit registers and `rq'
  295. for 64 bit registers.  You can also refer to the contents of the first
  296. eight (of the sixteen 16 bit registers) by bytes.  They are named `rNh'
  297. and `rNl'.
  298.  
  299. *byte registers*
  300.      r0l r0h r1h r1l r2h r2l r3h r3l
  301.      r4h r4l r5h r5l r6h r6l r7h r7l
  302. *word registers*
  303.      r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15
  304. *long word registers*
  305.      rr0 rr2 rr4 rr6 rr8 rr10 rr12 rr14
  306. *quad word registers*
  307.      rq0 rq4 rq8 rq12
  308.  
  309. 
  310. File: as.info,  Node: Z8000-Addressing,  Prev: Z8000-Regs,  Up: Z8000 Syntax
  311.  
  312. Addressing Modes
  313. ................
  314.  
  315.    as understands the following addressing modes for the Z8000:
  316.  
  317. `rN'
  318.      Register direct
  319.  
  320. `@rN'
  321.      Indirect register
  322.  
  323. `ADDR'
  324.      Direct: the 16 bit or 24 bit address (depending on whether the
  325.      assembler is in segmented or unsegmented mode) of the operand is
  326.      in the instruction.
  327.  
  328. `address(rN)'
  329.      Indexed: the 16 or 24 bit address is added to the 16 bit register
  330.      to produce the final address in memory of the operand.
  331.  
  332. `rN(#IMM)'
  333.      Base Address: the 16 or 24 bit register is added to the 16 bit sign
  334.      extended immediate displacement to produce the final address in
  335.      memory of the operand.
  336.  
  337. `rN(rM)'
  338.      Base Index: the 16 or 24 bit register rN is added to the sign
  339.      extended 16 bit index register rM to produce the final address in
  340.      memory of the operand.
  341.  
  342. `#XX'
  343.      Immediate data XX.
  344.  
  345. 
  346. File: as.info,  Node: Z8000 Directives,  Next: Z8000 Opcodes,  Prev: Z8000 Syntax,  Up: Z8000-Dependent
  347.  
  348. Assembler Directives for the Z8000
  349. ----------------------------------
  350.  
  351.    The Z8000 port of as includes these additional assembler directives,
  352. for compatibility with other Z8000 assemblers.  As shown, these do not
  353. begin with `.' (unlike the ordinary as directives).
  354.  
  355. `segm'
  356.      Generates code for the segmented Z8001.
  357.  
  358. `unsegm'
  359.      Generates code for the unsegmented Z8002.
  360.  
  361. `name'
  362.      Synonym for `.file'
  363.  
  364. `global'
  365.      Synonym for `.global'
  366.  
  367. `wval'
  368.      Synonym for `.word'
  369.  
  370. `lval'
  371.      Synonym for `.long'
  372.  
  373. `bval'
  374.      Synonym for `.byte'
  375.  
  376. `sval'
  377.      Assemble a string.  `sval' expects one string literal, delimited by
  378.      single quotes.  It assembles each byte of the string into
  379.      consecutive addresses.  You can use the escape sequence `%XX'
  380.      (where XX represents a two-digit hexadecimal number) to represent
  381.      the character whose ASCII value is XX.  Use this feature to
  382.      describe single quote and other characters that may not appear in
  383.      string literals as themselves.  For example, the C statement
  384.      `char *a = "he said \"it's 50% off\"";' is represented in Z8000
  385.      assembly language (shown with the assembler output in hex at the
  386.      left) as
  387.  
  388.           68652073    sval    'he said %22it%27s 50%25 off%22%00'
  389.           61696420
  390.           22697427
  391.           73203530
  392.           25206F66
  393.           662200
  394.  
  395. `rsect'
  396.      synonym for `.section'
  397.  
  398. `block'
  399.      synonym for `.space'
  400.  
  401. `even'
  402.      special case of `.align'; aligns output to even byte boundary.
  403.  
  404. 
  405. File: as.info,  Node: Z8000 Opcodes,  Prev: Z8000 Directives,  Up: Z8000-Dependent
  406.  
  407. Opcodes
  408. -------
  409.  
  410.    For detailed information on the Z8000 machine instruction set, see
  411. `Z8000 Technical Manual'.
  412.  
  413.    The following table summarizes the opcodes and their arguments:
  414.  
  415.                  rs   16 bit source register
  416.                  rd   16 bit destination register
  417.                  rbs   8 bit source register
  418.                  rbd   8 bit destination register
  419.                  rrs   32 bit source register
  420.                  rrd   32 bit destination register
  421.                  rqs   64 bit source register
  422.                  rqd   64 bit destination register
  423.                  addr 16/24 bit address
  424.                  imm  immediate data
  425.      
  426.      adc rd,rs               clrb addr               cpsir @rd,@rs,rr,cc
  427.      adcb rbd,rbs            clrb addr(rd)           cpsirb @rd,@rs,rr,cc
  428.      add rd,@rs              clrb rbd                dab rbd
  429.      add rd,addr             com @rd                 dbjnz rbd,disp7
  430.      add rd,addr(rs)         com addr                dec @rd,imm4m1
  431.      add rd,imm16            com addr(rd)            dec addr(rd),imm4m1
  432.      add rd,rs               com rd                  dec addr,imm4m1
  433.      addb rbd,@rs            comb @rd                dec rd,imm4m1
  434.      addb rbd,addr           comb addr               decb @rd,imm4m1
  435.      addb rbd,addr(rs)       comb addr(rd)           decb addr(rd),imm4m1
  436.      addb rbd,imm8           comb rbd                decb addr,imm4m1
  437.      addb rbd,rbs            comflg flags            decb rbd,imm4m1
  438.      addl rrd,@rs            cp @rd,imm16            di i2
  439.      addl rrd,addr           cp addr(rd),imm16       div rrd,@rs
  440.      addl rrd,addr(rs)       cp addr,imm16           div rrd,addr
  441.      addl rrd,imm32          cp rd,@rs               div rrd,addr(rs)
  442.      addl rrd,rrs            cp rd,addr              div rrd,imm16
  443.      and rd,@rs              cp rd,addr(rs)          div rrd,rs
  444.      and rd,addr             cp rd,imm16             divl rqd,@rs
  445.      and rd,addr(rs)         cp rd,rs                divl rqd,addr
  446.      and rd,imm16            cpb @rd,imm8            divl rqd,addr(rs)
  447.      and rd,rs               cpb addr(rd),imm8       divl rqd,imm32
  448.      andb rbd,@rs            cpb addr,imm8           divl rqd,rrs
  449.      andb rbd,addr           cpb rbd,@rs             djnz rd,disp7
  450.      andb rbd,addr(rs)       cpb rbd,addr            ei i2
  451.      andb rbd,imm8           cpb rbd,addr(rs)        ex rd,@rs
  452.      andb rbd,rbs            cpb rbd,imm8            ex rd,addr
  453.      bit @rd,imm4            cpb rbd,rbs             ex rd,addr(rs)
  454.      bit addr(rd),imm4       cpd rd,@rs,rr,cc        ex rd,rs
  455.      bit addr,imm4           cpdb rbd,@rs,rr,cc      exb rbd,@rs
  456.      bit rd,imm4             cpdr rd,@rs,rr,cc       exb rbd,addr
  457.      bit rd,rs               cpdrb rbd,@rs,rr,cc     exb rbd,addr(rs)
  458.      bitb @rd,imm4           cpi rd,@rs,rr,cc        exb rbd,rbs
  459.      bitb addr(rd),imm4      cpib rbd,@rs,rr,cc      ext0e imm8
  460.      bitb addr,imm4          cpir rd,@rs,rr,cc       ext0f imm8
  461.      bitb rbd,imm4           cpirb rbd,@rs,rr,cc     ext8e imm8
  462.      bitb rbd,rs             cpl rrd,@rs             ext8f imm8
  463.      bpt                     cpl rrd,addr            exts rrd
  464.      call @rd                cpl rrd,addr(rs)        extsb rd
  465.      call addr               cpl rrd,imm32           extsl rqd
  466.      call addr(rd)           cpl rrd,rrs             halt
  467.      calr disp12             cpsd @rd,@rs,rr,cc      in rd,@rs
  468.      clr @rd                 cpsdb @rd,@rs,rr,cc     in rd,imm16
  469.      clr addr                cpsdr @rd,@rs,rr,cc     inb rbd,@rs
  470.      clr addr(rd)            cpsdrb @rd,@rs,rr,cc    inb rbd,imm16
  471.      clr rd                  cpsi @rd,@rs,rr,cc      inc @rd,imm4m1
  472.      clrb @rd                cpsib @rd,@rs,rr,cc     inc addr(rd),imm4m1
  473.      inc addr,imm4m1         ldb rbd,rs(rx)          mult rrd,addr(rs)
  474.      inc rd,imm4m1           ldb rd(imm16),rbs       mult rrd,imm16
  475.      incb @rd,imm4m1         ldb rd(rx),rbs          mult rrd,rs
  476.      incb addr(rd),imm4m1    ldctl ctrl,rs           multl rqd,@rs
  477.      incb addr,imm4m1        ldctl rd,ctrl           multl rqd,addr
  478.      incb rbd,imm4m1         ldd @rs,@rd,rr          multl rqd,addr(rs)
  479.      ind @rd,@rs,ra          lddb @rs,@rd,rr         multl rqd,imm32
  480.      indb @rd,@rs,rba        lddr @rs,@rd,rr         multl rqd,rrs
  481.      inib @rd,@rs,ra         lddrb @rs,@rd,rr        neg @rd
  482.      inibr @rd,@rs,ra        ldi @rd,@rs,rr          neg addr
  483.      iret                    ldib @rd,@rs,rr         neg addr(rd)
  484.      jp cc,@rd               ldir @rd,@rs,rr         neg rd
  485.      jp cc,addr              ldirb @rd,@rs,rr        negb @rd
  486.      jp cc,addr(rd)          ldk rd,imm4             negb addr
  487.      jr cc,disp8             ldl @rd,rrs             negb addr(rd)
  488.      ld @rd,imm16            ldl addr(rd),rrs        negb rbd
  489.      ld @rd,rs               ldl addr,rrs            nop
  490.      ld addr(rd),imm16       ldl rd(imm16),rrs       or rd,@rs
  491.      ld addr(rd),rs          ldl rd(rx),rrs          or rd,addr
  492.      ld addr,imm16           ldl rrd,@rs             or rd,addr(rs)
  493.      ld addr,rs              ldl rrd,addr            or rd,imm16
  494.      ld rd(imm16),rs         ldl rrd,addr(rs)        or rd,rs
  495.      ld rd(rx),rs            ldl rrd,imm32           orb rbd,@rs
  496.      ld rd,@rs               ldl rrd,rrs             orb rbd,addr
  497.      ld rd,addr              ldl rrd,rs(imm16)       orb rbd,addr(rs)
  498.      ld rd,addr(rs)          ldl rrd,rs(rx)          orb rbd,imm8
  499.      ld rd,imm16             ldm @rd,rs,n            orb rbd,rbs
  500.      ld rd,rs                ldm addr(rd),rs,n       out @rd,rs
  501.      ld rd,rs(imm16)         ldm addr,rs,n           out imm16,rs
  502.      ld rd,rs(rx)            ldm rd,@rs,n            outb @rd,rbs
  503.      lda rd,addr             ldm rd,addr(rs),n       outb imm16,rbs
  504.      lda rd,addr(rs)         ldm rd,addr,n           outd @rd,@rs,ra
  505.      lda rd,rs(imm16)        ldps @rs                outdb @rd,@rs,rba
  506.      lda rd,rs(rx)           ldps addr               outib @rd,@rs,ra
  507.      ldar rd,disp16          ldps addr(rs)           outibr @rd,@rs,ra
  508.      ldb @rd,imm8            ldr disp16,rs           pop @rd,@rs
  509.      ldb @rd,rbs             ldr rd,disp16           pop addr(rd),@rs
  510.      ldb addr(rd),imm8       ldrb disp16,rbs         pop addr,@rs
  511.      ldb addr(rd),rbs        ldrb rbd,disp16         pop rd,@rs
  512.      ldb addr,imm8           ldrl disp16,rrs         popl @rd,@rs
  513.      ldb addr,rbs            ldrl rrd,disp16         popl addr(rd),@rs
  514.      ldb rbd,@rs             mbit                    popl addr,@rs
  515.      ldb rbd,addr            mreq rd                 popl rrd,@rs
  516.      ldb rbd,addr(rs)        mres                    push @rd,@rs
  517.      ldb rbd,imm8            mset                    push @rd,addr
  518.      ldb rbd,rbs             mult rrd,@rs            push @rd,addr(rs)
  519.      ldb rbd,rs(imm16)       mult rrd,addr           push @rd,imm16
  520.      push @rd,rs             set addr,imm4           subl rrd,imm32
  521.      pushl @rd,@rs           set rd,imm4             subl rrd,rrs
  522.      pushl @rd,addr          set rd,rs               tcc cc,rd
  523.      pushl @rd,addr(rs)      setb @rd,imm4           tccb cc,rbd
  524.      pushl @rd,rrs           setb addr(rd),imm4      test @rd
  525.      res @rd,imm4            setb addr,imm4          test addr
  526.      res addr(rd),imm4       setb rbd,imm4           test addr(rd)
  527.      res addr,imm4           setb rbd,rs             test rd
  528.      res rd,imm4             setflg imm4             testb @rd
  529.      res rd,rs               sinb rbd,imm16          testb addr
  530.      resb @rd,imm4           sinb rd,imm16           testb addr(rd)
  531.      resb addr(rd),imm4      sind @rd,@rs,ra         testb rbd
  532.      resb addr,imm4          sindb @rd,@rs,rba       testl @rd
  533.      resb rbd,imm4           sinib @rd,@rs,ra        testl addr
  534.      resb rbd,rs             sinibr @rd,@rs,ra       testl addr(rd)
  535.      resflg imm4             sla rd,imm8             testl rrd
  536.      ret cc                  slab rbd,imm8           trdb @rd,@rs,rba
  537.      rl rd,imm1or2           slal rrd,imm8           trdrb @rd,@rs,rba
  538.      rlb rbd,imm1or2         sll rd,imm8             trib @rd,@rs,rbr
  539.      rlc rd,imm1or2          sllb rbd,imm8           trirb @rd,@rs,rbr
  540.      rlcb rbd,imm1or2        slll rrd,imm8           trtdrb @ra,@rb,rbr
  541.      rldb rbb,rba            sout imm16,rs           trtib @ra,@rb,rr
  542.      rr rd,imm1or2           soutb imm16,rbs         trtirb @ra,@rb,rbr
  543.      rrb rbd,imm1or2         soutd @rd,@rs,ra        trtrb @ra,@rb,rbr
  544.      rrc rd,imm1or2          soutdb @rd,@rs,rba      tset @rd
  545.      rrcb rbd,imm1or2        soutib @rd,@rs,ra       tset addr
  546.      rrdb rbb,rba            soutibr @rd,@rs,ra      tset addr(rd)
  547.      rsvd36                  sra rd,imm8             tset rd
  548.      rsvd38                  srab rbd,imm8           tsetb @rd
  549.      rsvd78                  sral rrd,imm8           tsetb addr
  550.      rsvd7e                  srl rd,imm8             tsetb addr(rd)
  551.      rsvd9d                  srlb rbd,imm8           tsetb rbd
  552.      rsvd9f                  srll rrd,imm8           xor rd,@rs
  553.      rsvdb9                  sub rd,@rs              xor rd,addr
  554.      rsvdbf                  sub rd,addr             xor rd,addr(rs)
  555.      sbc rd,rs               sub rd,addr(rs)         xor rd,imm16
  556.      sbcb rbd,rbs            sub rd,imm16            xor rd,rs
  557.      sc imm8                 sub rd,rs               xorb rbd,@rs
  558.      sda rd,rs               subb rbd,@rs            xorb rbd,addr
  559.      sdab rbd,rs             subb rbd,addr           xorb rbd,addr(rs)
  560.      sdal rrd,rs             subb rbd,addr(rs)       xorb rbd,imm8
  561.      sdl rd,rs               subb rbd,imm8           xorb rbd,rbs
  562.      sdlb rbd,rs             subb rbd,rbs            xorb rbd,rbs
  563.      sdll rrd,rs             subl rrd,@rs
  564.      set @rd,imm4            subl rrd,addr
  565.      set addr(rd),imm4       subl rrd,addr(rs)
  566.  
  567. 
  568. File: as.info,  Node: Vax-Dependent,  Prev: Z8000-Dependent,  Up: Machine Dependencies
  569.  
  570. VAX Dependent Features
  571. ======================
  572.  
  573. * Menu:
  574.  
  575. * VAX-Opts::                    VAX Command-Line Options
  576. * VAX-float::                   VAX Floating Point
  577. * VAX-directives::              Vax Machine Directives
  578. * VAX-opcodes::                 VAX Opcodes
  579. * VAX-branch::                  VAX Branch Improvement
  580. * VAX-operands::                VAX Operands
  581. * VAX-no::                      Not Supported on VAX
  582.  
  583. 
  584. File: as.info,  Node: VAX-Opts,  Next: VAX-float,  Up: Vax-Dependent
  585.  
  586. VAX Command-Line Options
  587. ------------------------
  588.  
  589.    The Vax version of `as' accepts any of the following options, gives
  590. a warning message that the option was ignored and proceeds.  These
  591. options are for compatibility with scripts designed for other people's
  592. assemblers.
  593.  
  594. ``-D' (Debug)'
  595. ``-S' (Symbol Table)'
  596. ``-T' (Token Trace)'
  597.      These are obsolete options used to debug old assemblers.
  598.  
  599. ``-d' (Displacement size for JUMPs)'
  600.      This option expects a number following the `-d'.  Like options
  601.      that expect filenames, the number may immediately follow the `-d'
  602.      (old standard) or constitute the whole of the command line
  603.      argument that follows `-d' (GNU standard).
  604.  
  605. ``-V' (Virtualize Interpass Temporary File)'
  606.      Some other assemblers use a temporary file.  This option commanded
  607.      them to keep the information in active memory rather than in a
  608.      disk file.  `as' always does this, so this option is redundant.
  609.  
  610. ``-J' (JUMPify Longer Branches)'
  611.      Many 32-bit computers permit a variety of branch instructions to
  612.      do the same job.  Some of these instructions are short (and fast)
  613.      but have a limited range; others are long (and slow) but can
  614.      branch anywhere in virtual memory.  Often there are 3 flavors of
  615.      branch: short, medium and long.  Some other assemblers would emit
  616.      short and medium branches, unless told by this option to emit
  617.      short and long branches.
  618.  
  619. ``-t' (Temporary File Directory)'
  620.      Some other assemblers may use a temporary file, and this option
  621.      takes a filename being the directory to site the temporary file.
  622.      Since `as' does not use a temporary disk file, this option makes
  623.      no difference.  `-t' needs exactly one filename.
  624.  
  625.    The Vax version of the assembler accepts two options when compiled
  626. for VMS.  They are `-h', and `-+'.  The `-h' option prevents `as' from
  627. modifying the symbol-table entries for symbols that contain lowercase
  628. characters (I think).  The `-+' option causes `as' to print warning
  629. messages if the FILENAME part of the object file, or any symbol name is
  630. larger than 31 characters.  The `-+' option also inserts some code
  631. following the `_main' symbol so that the object file is compatible with
  632. Vax-11 "C".
  633.  
  634. 
  635. File: as.info,  Node: VAX-float,  Next: VAX-directives,  Prev: VAX-Opts,  Up: Vax-Dependent
  636.  
  637. VAX Floating Point
  638. ------------------
  639.  
  640.    Conversion of flonums to floating point is correct, and compatible
  641. with previous assemblers.  Rounding is towards zero if the remainder is
  642. exactly half the least significant bit.
  643.  
  644.    `D', `F', `G' and `H' floating point formats are understood.
  645.  
  646.    Immediate floating literals (*e.g.* `S`$6.9') are rendered
  647. correctly.  Again, rounding is towards zero in the boundary case.
  648.  
  649.    The `.float' directive produces `f' format numbers.  The `.double'
  650. directive produces `d' format numbers.
  651.  
  652. 
  653. File: as.info,  Node: VAX-directives,  Next: VAX-opcodes,  Prev: VAX-float,  Up: Vax-Dependent
  654.  
  655. Vax Machine Directives
  656. ----------------------
  657.  
  658.    The Vax version of the assembler supports four directives for
  659. generating Vax floating point constants.  They are described in the
  660. table below.
  661.  
  662. `.dfloat'
  663.      This expects zero or more flonums, separated by commas, and
  664.      assembles Vax `d' format 64-bit floating point constants.
  665.  
  666. `.ffloat'
  667.      This expects zero or more flonums, separated by commas, and
  668.      assembles Vax `f' format 32-bit floating point constants.
  669.  
  670. `.gfloat'
  671.      This expects zero or more flonums, separated by commas, and
  672.      assembles Vax `g' format 64-bit floating point constants.
  673.  
  674. `.hfloat'
  675.      This expects zero or more flonums, separated by commas, and
  676.      assembles Vax `h' format 128-bit floating point constants.
  677.  
  678. 
  679. File: as.info,  Node: VAX-opcodes,  Next: VAX-branch,  Prev: VAX-directives,  Up: Vax-Dependent
  680.  
  681. VAX Opcodes
  682. -----------
  683.  
  684.    All DEC mnemonics are supported.  Beware that `case...' instructions
  685. have exactly 3 operands.  The dispatch table that follows the `case...'
  686. instruction should be made with `.word' statements.  This is compatible
  687. with all unix assemblers we know of.
  688.  
  689. 
  690. File: as.info,  Node: VAX-branch,  Next: VAX-operands,  Prev: VAX-opcodes,  Up: Vax-Dependent
  691.  
  692. VAX Branch Improvement
  693. ----------------------
  694.  
  695.    Certain pseudo opcodes are permitted.  They are for branch
  696. instructions.  They expand to the shortest branch instruction that
  697. reaches the target.  Generally these mnemonics are made by substituting
  698. `j' for `b' at the start of a DEC mnemonic.  This feature is included
  699. both for compatibility and to help compilers.  If you do not need this
  700. feature, avoid these opcodes.  Here are the mnemonics, and the code
  701. they can expand into.
  702.  
  703. `jbsb'
  704.      `Jsb' is already an instruction mnemonic, so we chose `jbsb'.
  705.     (byte displacement)
  706.           `bsbb ...'
  707.  
  708.     (word displacement)
  709.           `bsbw ...'
  710.  
  711.     (long displacement)
  712.           `jsb ...'
  713.  
  714. `jbr'
  715. `jr'
  716.      Unconditional branch.
  717.     (byte displacement)
  718.           `brb ...'
  719.  
  720.     (word displacement)
  721.           `brw ...'
  722.  
  723.     (long displacement)
  724.           `jmp ...'
  725.  
  726. `jCOND'
  727.      COND may be any one of the conditional branches `neq', `nequ',
  728.      `eql', `eqlu', `gtr', `geq', `lss', `gtru', `lequ', `vc', `vs',
  729.      `gequ', `cc', `lssu', `cs'.  COND may also be one of the bit tests
  730.      `bs', `bc', `bss', `bcs', `bsc', `bcc', `bssi', `bcci', `lbs',
  731.      `lbc'.  NOTCOND is the opposite condition to COND.
  732.     (byte displacement)
  733.           `bCOND ...'
  734.  
  735.     (word displacement)
  736.           `bNOTCOND foo ; brw ... ; foo:'
  737.  
  738.     (long displacement)
  739.           `bNOTCOND foo ; jmp ... ; foo:'
  740.  
  741. `jacbX'
  742.      X may be one of `b d f g h l w'.
  743.     (word displacement)
  744.           `OPCODE ...'
  745.  
  746.     (long displacement)
  747.                OPCODE ..., foo ;
  748.                brb bar ;
  749.                foo: jmp ... ;
  750.                bar:
  751.  
  752. `jaobYYY'
  753.      YYY may be one of `lss leq'.
  754.  
  755. `jsobZZZ'
  756.      ZZZ may be one of `geq gtr'.
  757.     (byte displacement)
  758.           `OPCODE ...'
  759.  
  760.     (word displacement)
  761.                OPCODE ..., foo ;
  762.                brb bar ;
  763.                foo: brw DESTINATION ;
  764.                bar:
  765.  
  766.     (long displacement)
  767.                OPCODE ..., foo ;
  768.                brb bar ;
  769.                foo: jmp DESTINATION ;
  770.                bar:
  771.  
  772. `aobleq'
  773. `aoblss'
  774. `sobgeq'
  775. `sobgtr'
  776.     (byte displacement)
  777.           `OPCODE ...'
  778.  
  779.     (word displacement)
  780.                OPCODE ..., foo ;
  781.                brb bar ;
  782.                foo: brw DESTINATION ;
  783.                bar:
  784.  
  785.     (long displacement)
  786.                OPCODE ..., foo ;
  787.                brb bar ;
  788.                foo: jmp DESTINATION ;
  789.                bar:
  790.  
  791. 
  792. File: as.info,  Node: VAX-operands,  Next: VAX-no,  Prev: VAX-branch,  Up: Vax-Dependent
  793.  
  794. VAX Operands
  795. ------------
  796.  
  797.    The immediate character is `$' for Unix compatibility, not `#' as
  798. DEC writes it.
  799.  
  800.    The indirect character is `*' for Unix compatibility, not `@' as DEC
  801. writes it.
  802.  
  803.    The displacement sizing character is ``' (an accent grave) for Unix
  804. compatibility, not `^' as DEC writes it.  The letter preceding ``' may
  805. have either case.  `G' is not understood, but all other letters (`b i l
  806. s w') are understood.
  807.  
  808.    Register names understood are `r0 r1 r2 ... r15 ap fp sp pc'.  Upper
  809. and lower case letters are equivalent.
  810.  
  811.    For instance
  812.      tstb *w`$4(r5)
  813.  
  814.    Any expression is permitted in an operand.  Operands are comma
  815. separated.
  816.  
  817. 
  818. File: as.info,  Node: VAX-no,  Prev: VAX-operands,  Up: Vax-Dependent
  819.  
  820. Not Supported on VAX
  821. --------------------
  822.  
  823.    Vax bit fields can not be assembled with `as'.  Someone can add the
  824. required code if they really need it.
  825.  
  826. 
  827. File: as.info,  Node: Acknowledgements,  Next: Index,  Prev: Machine Dependencies,  Up: Top
  828.  
  829. Acknowledgements
  830. ****************
  831.  
  832.    If you have contributed to `as' and your name isn't listed here, it
  833. is not meant as a slight.  We just don't know about it.  Send mail to
  834. the maintainer, and we'll correct the situation.  Currently the
  835. maintainer is Ken Raeburn (email address `raeburn@cygnus.com').
  836.  
  837.    Dean Elsner wrote the original GNU assembler for the VAX.(1)
  838.  
  839.    Jay Fenlason maintained GAS for a while, adding support for
  840. GDB-specific debug information and the 68k series machines, most of the
  841. preprocessing pass, and extensive changes in `messages.c',
  842. `input-file.c', `write.c'.
  843.  
  844.    K. Richard Pixley maintained GAS for a while, adding various
  845. enhancements and many bug fixes, including merging support for several
  846. processors, breaking GAS up to handle multiple object file format back
  847. ends (including heavy rewrite, testing, an integration of the coff and
  848. b.out back ends), adding configuration including heavy testing and
  849. verification of cross assemblers and file splits and renaming,
  850. converted GAS to strictly ANSI C including full prototypes, added
  851. support for m680[34]0 and cpu32, did considerable work on i960
  852. including a COFF port (including considerable amounts of reverse
  853. engineering), a SPARC opcode file rewrite, DECstation, rs6000, and
  854. hp300hpux host ports, updated "know" assertions and made them work,
  855. much other reorganization, cleanup, and lint.
  856.  
  857.    Ken Raeburn wrote the high-level BFD interface code to replace most
  858. of the code in format-specific I/O modules.
  859.  
  860.    The original VMS support was contributed by David L. Kashtan.  Eric
  861. Youngdale has done much work with it since.
  862.  
  863.    The Intel 80386 machine description was written by Eliot Dresselhaus.
  864.  
  865.    Minh Tran-Le at IntelliCorp contributed some AIX 386 support.
  866.  
  867.    The Motorola 88k machine description was contributed by Devon Bowen
  868. of Buffalo University and Torbjorn Granlund of the Swedish Institute of
  869. Computer Science.
  870.  
  871.    Keith Knowles at the Open Software Foundation wrote the original
  872. MIPS back end (`tc-mips.c', `tc-mips.h'), and contributed Rose format
  873. support (which hasn't been merged in yet).  Ralph Campbell worked with
  874. the MIPS code to support a.out format.
  875.  
  876.    Support for the Zilog Z8k and Hitachi H8/300 and H8/500 processors
  877. (tc-z8k, tc-h8300, tc-h8500), and IEEE 695 object file format
  878. (obj-ieee), was written by Steve Chamberlain of Cygnus Support.  Steve
  879. also modified the COFF back end to use BFD for some low-level
  880. operations, for use with the H8/300 and AMD 29k targets.
  881.  
  882.    John Gilmore built the AMD 29000 support, added `.include' support,
  883. and simplified the configuration of which versions accept which
  884. directives.  He updated the 68k machine description so that Motorola's
  885. opcodes always produced fixed-size instructions (e.g. `jsr'), while
  886. synthetic instructions remained shrinkable (`jbsr').  John fixed many
  887. bugs, including true tested cross-compilation support, and one bug in
  888. relaxation that took a week and required the proverbial one-bit fix.
  889.  
  890.    Ian Lance Taylor of Cygnus Support merged the Motorola and MIT
  891. syntax for the 68k, completed support for some COFF targets (68k, i386
  892. SVR3, and SCO Unix), added support for MIPS ECOFF and ELF targets,
  893. wrote the initial RS/6000 and PowerPC assembler, and made a few other
  894. minor patches.
  895.  
  896.    Steve Chamberlain made `as' able to generate listings.
  897.  
  898.    Hewlett-Packard contributed support for the HP9000/300.
  899.  
  900.    Jeff Law wrote GAS and BFD support for the native HPPA object format
  901. (SOM) along with a fairly extensive HPPA testsuite (for both SOM and
  902. ELF object formats).  This work was supported by both the Center for
  903. Software Science at the University of Utah and Cygnus Support.
  904.  
  905.    Support for ELF format files has been worked on by Mark Eichin of
  906. Cygnus Support (original, incomplete implementation for SPARC), Pete
  907. Hoogenboom and Jeff Law at the University of Utah (HPPA mainly),
  908. Michael Meissner of the Open Software Foundation (i386 mainly), and Ken
  909. Raeburn of Cygnus Support (sparc, and some initial 64-bit support).
  910.  
  911.    Richard Henderson rewrote the Alpha assembler.
  912.  
  913.    Several engineers at Cygnus Support have also provided many small
  914. bug fixes and configuration enhancements.
  915.  
  916.    Many others have contributed large or small bugfixes and
  917. enhancements.  If you have contributed significant work and are not
  918. mentioned on this list, and want to be, let us know.  Some of the
  919. history has been lost; we are not intentionally leaving anyone out.
  920.  
  921.    ---------- Footnotes ----------
  922.  
  923.    (1)  Any more details?
  924.  
  925.